package com.young.springdemo.service.observerPattern;

//具体观察者
public class Player implements Observer {
    private String name;

    public Player(String name) {
        this.name = name;
    }

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public void setName(String name) {

    }

    @Override
    public void help() {
        System.out.println(this.name+"出发去救你了....");

    }

    @Override
    public void beAttacked(AllyControllerCenter allyControllerCenter) {
        System.out.println(this.name+"被攻击了,需要大家的帮助");
        allyControllerCenter.notify(this.name);
    }
}
